function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
% function g1 = dynamic_g1(T, y, x, params, steady_state, it_, T_flag)
%
% File created by Dynare Preprocessor from .mod file
%
% Inputs:
%   T             [#temp variables by 1]     double   vector of temporary terms to be filled by function
%   y             [#dynamic variables by 1]  double   vector of endogenous variables in the order stored
%                                                     in M_.lead_lag_incidence; see the Manual
%   x             [nperiods by M_.exo_nbr]   double   matrix of exogenous variables (in declaration order)
%                                                     for all simulation periods
%   steady_state  [M_.endo_nbr by 1]         double   vector of steady state values
%   params        [M_.param_nbr by 1]        double   vector of parameter values in declaration order
%   it_           scalar                     double   time period for exogenous variables for which
%                                                     to evaluate the model
%   T_flag        boolean                    boolean  flag saying whether or not to calculate temporary terms
%
% Output:
%   g1
%

if T_flag
    T = model_htm.dynamic_g1_tt(T, y, x, params, steady_state, it_);
end
g1 = zeros(36, 54);
g1(1,18)=(-(params(4)*(1-params(3))));
g1(1,20)=params(1);
g1(1,24)=(-(params(3)*T(1)*(-params(13))*(1-T(1))));
g1(1,29)=(-(params(1)-params(4)*(1-params(3))));
g1(2,19)=(-((1-params(3))*(1-params(4))));
g1(2,21)=1-params(1);
g1(2,24)=(-(T(1)*params(3)*params(13)*(1-T(1))));
g1(2,29)=(-(params(3)*(1-T(1))));
g1(3,20)=(-(params(8)*(1-params(11))*(1-params(11)*params(9))));
g1(3,22)=params(11);
g1(3,48)=(-(params(11)*params(9)));
g1(3,24)=(-((1-params(11))*(1-params(11)*params(9))*(-(1-T(1)))));
g1(3,29)=(-((1-params(11))*(1-params(11)*params(9))*params(7)));
g1(4,21)=(-(params(8)*(1-params(12))*(1-params(9)*params(12))));
g1(4,23)=params(12);
g1(4,49)=(-(params(9)*params(12)));
g1(4,24)=(-(T(1)*(1-params(12))*(1-params(9)*params(12))));
g1(4,29)=(-(params(7)*(1-params(12))*(1-params(9)*params(12))));
g1(5,28)=(-params(14));
g1(5,36)=params(10);
g1(6,20)=T(7);
g1(6,46)=(-T(7));
g1(6,38)=1;
g1(7,21)=T(8);
g1(7,47)=(-T(8));
g1(7,39)=1;
g1(8,51)=T(4);
g1(8,40)=1;
g1(8,52)=(-T(4));
g1(9,28)=T(5);
g1(9,29)=params(7);
g1(9,50)=(-params(7));
g1(9,51)=(-T(5));
g1(9,38)=1;
g1(9,39)=1;
g1(9,40)=(-1);
g1(10,22)=(-T(1));
g1(10,23)=(-(1-T(1)));
g1(10,36)=1;
g1(11,22)=(-params(1));
g1(11,23)=(-(1-params(1)));
g1(11,27)=1;
g1(12,20)=(-params(1));
g1(12,21)=(-(1-params(1)));
g1(12,25)=1;
g1(13,18)=(-params(4));
g1(13,19)=(-(1-params(4)));
g1(13,26)=1;
g1(14,22)=(-1);
g1(14,23)=1;
g1(14,5)=(-1);
g1(14,24)=1;
g1(15,1)=(-params(5));
g1(15,11)=1;
g1(15,53)=(-params(23));
g1(16,2)=(-params(6));
g1(16,12)=1;
g1(16,54)=(-params(24));
g1(17,11)=(-0.16);
g1(17,18)=1;
g1(18,12)=(-0.16);
g1(18,19)=1;
g1(19,6)=params(18);
g1(19,26)=(-params(18));
g1(19,9)=(-params(17));
g1(19,42)=1;
g1(19,43)=(-params(18));
g1(20,6)=1-params(3);
g1(20,26)=(-(1-params(3)));
g1(20,9)=(-T(6));
g1(20,41)=1;
g1(20,42)=1-params(3);
g1(20,43)=(-(1-params(3)));
g1(21,43)=1;
g1(21,44)=(-params(4));
g1(21,45)=(-(1-params(4)));
g1(22,3)=params(8);
g1(22,20)=(-params(8));
g1(22,7)=1;
g1(22,29)=(-1);
g1(22,36)=(-1);
g1(22,44)=1;
g1(23,4)=params(8);
g1(23,21)=(-params(8));
g1(23,7)=1;
g1(23,29)=(-1);
g1(23,36)=(-1);
g1(23,45)=1;
g1(24,10)=1;
g1(24,11)=(-1);
g1(24,12)=(-1);
g1(25,23)=1;
g1(25,8)=1;
g1(25,31)=(-1);
g1(26,24)=(-1);
g1(26,30)=1;
g1(26,31)=(-(1/T(1)));
g1(27,26)=(-1);
g1(27,29)=(-1);
g1(27,32)=1;
g1(28,48)=T(1);
g1(28,49)=1-T(1);
g1(28,28)=(-1);
g1(28,33)=1;
g1(29,29)=(-params(3));
g1(29,34)=1;
g1(30,26)=(-(1-params(3)));
g1(30,35)=1;
g1(31,14)=1;
g1(31,35)=(-((1-params(3))*params(4)/params(1)));
g1(32,15)=1;
g1(32,35)=(-((1-params(3))*(1-params(4))/(1-params(1))));
g1(33,28)=(-12);
g1(33,37)=1;
g1(34,16)=1;
g1(34,20)=params(8);
g1(34,24)=(-(1-T(1)));
g1(34,29)=params(7);
g1(35,17)=1;
g1(35,21)=params(8);
g1(35,24)=T(1);
g1(35,29)=params(7);
g1(36,13)=1;
g1(36,16)=(-params(1));
g1(36,17)=(-(1-params(1)));

end
